import { styled } from "styled-components";

const RoomItemWrapper = styled.div`
  flex-shrink: 0;
  width: ${(props) => props.itemwidth};
  padding: 8px;
  margin-bottom: 4px;
  box-sizing: border-box;
  .inner {
    /* 箭头 */
    .swiper {
      position: relative;
      cursor: pointer;
      .indicator{
        position: absolute;
        z-index: 9;
        left: 0;
        right: 0;
        bottom: 10px;
        margin: 0 auto;
        width: 30%;
        
        .dots{
          display: flex;
          justify-content: center;
          align-items: center;
          width: 14.29%;
          .dot{
          width: 6px;
          height: 6px;
          background-color: #fff;
          border-radius: 50%;
          &.active{
          width: 8px;
          height: 8px;
          background-color: red;
        }
        }
        
          
        }
        
      }
      &:hover {
        .control {
          /* 显示 */
          display: flex;
        }
      }

      .control {
        /* 隐藏 */
        display: none;
        justify-content: space-between;
        position: absolute;
        z-index: 1;
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
        color: #fff;
        .btn {
          display: flex;
          align-items: center;
          justify-content: center;
          height: auto;
          width: 83px;
          background: linear-gradient(
            to left,
            transparent 0%,
            rgba(0, 0, 0, 0.25) 100%
          );
          &.right {
          background: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.25) 100%);
        }

        }
      }
    }
    .cover {
      position: relative;
      padding: 66.6% 0 8px;
      overflow: hidden;
      box-sizing: border-box;
      border-radius: 4px;
      img {
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        position: absolute;
        object-fit: cover;
      }
    }
    .content {
      .desc {
        font-size: 12;
        font-weight: 700;
        padding: 8px 0;
        color: ${(props) => props.textcolor};
      }
      .name {
        font-size: 16px;
        font-weight: 700;
        height: 50.28px;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
      }
      .price {
        margin: 2px 0;
      }
      .count {
        padding: 0 4px 0 2px;
      }
    }
  }
`;

export default RoomItemWrapper;
